#!/usr/bin/env python
# coding: utf-8
from os import system
import sys
import Image, ImageDraw, ImageFont

system('mkdir {0}'.format(sys.argv[1]))
system('mkdir {0}/caps'.format(sys.argv[1]))

letters = range(0x0061, 0x007B)

for (i, letter) in enumerate(letters):
    uletter = unichr(letter)
    im = Image.new("RGB", (256, 256))
    d = ImageDraw.Draw(im)
    f = ImageFont.truetype('/home/moos/Downloads/ARIALUNI.TTF', 150)
    d.text((128 - f.getsize(uletter)[0]/2 - 1, 128- f.getsize(uletter)[1]/2 - 1), uletter, font=f)
    im.save(open(u"{0}/{1}.png".format(sys.argv[1], unichr(letter)).encode('utf-8'), "wb"), "PNG")

print "Font written to directory {0}.".format(sys.argv[1])
